package com.pty.demo.structural.facade;

/**
 * @author pengty
 * @date 2020/3/12
 */
public class TMallElfFacade {

    private LightSub lightSub;

    private AirConditioningSub airConditioningSub;

    private TvSub tvSub;

    public TMallElfFacade() {
        this.lightSub = new LightSub();
        this.airConditioningSub = new AirConditioningSub();
        this.tvSub = new TvSub();
    }

    public void open(){
        System.out.println("天猫精灵 欢迎主人回家");
        lightSub.open();
        airConditioningSub.open();
        tvSub.open();
        System.out.println("全屋智能家居已开启");
    }

    public void close(){
        System.out.println("天猫精灵 睡觉了");
        lightSub.close();
        airConditioningSub.close();
        tvSub.close();
        System.out.println("全屋智能家居已关闭");
    }
}
